// represents a list of Buddies
class ConsLoBuddy implements ILoBuddy {

	Person first;
	ILoBuddy rest;

	ConsLoBuddy(Person first, ILoBuddy rest) {
		this.first = first;
		this.rest = rest;
	}
	
	@Override
	// Adds a given person is in a ILoBuddy.
	public ILoBuddy add(Person p){
		return new ConsLoBuddy(this.first, this.rest.add(p));
	}

	@Override
	// Checks if the ILoBuddy has a specified person.
	public boolean contains(Person that) {
		// Checks if that person is the first element else recurses through the rest.
		if (this.first.compareTo(that)){
			return true;
		} else {
			return this.rest.contains(that);
		}
	}

	@Override
	// Counts the list of buddies.
	public int count() {
		// Recursively counts the list.
		return 1 + this.rest.count();
	}

	@Override
	// Compares the first and rest of an ILoBuddy.
	public boolean compareTo(ILoBuddy lob) {
		// TODO Auto-generated method stub
		return lob.count() >= 1 &&  
		this.first.compareTo(((ConsLoBuddy)lob).first) && 
		this.rest.compareTo(((ConsLoBuddy)lob).rest);
	}

	@Override
	// Filters out the uncommon members of the list.
	public ILoBuddy filter(ILoBuddy that) {
		// Checks if the 
		return null;
	}

}